module.exports = (sequelize, Sequelize) => {
  const user_follows = sequelize.define('user_follows', {
    id: {
      type: Sequelize.INTEGER,
      autoIncrement: true,
      primaryKey: true
    },
    user_id: {
      type: Sequelize.INTEGER,
      allowNull: false
    },
    follows_id: {
      type: Sequelize.INTEGER,
      allowNull: false
      
    },
    created_at: {
      type: Sequelize.DATE,
      allowNull: false,
      defaultValue: Sequelize.NOW,
      get() {
        const date = this.getDataValue('created_at')
        return date ? date.toISOString().slice(0, 10) : null
      }
    },
  }, {
    timestamps: false,
    underscored: true,
    tableName: 'user_follows'
  })
  return user_follows
} 